home *** CD-ROM | disk | FTP | other *** search
/ ftp.mactech.com 2010 / ftp.mactech.com.tar / ftp.mactech.com / thinkref / archive / THINKPascalUH2.1.sea / THINKPas Univ Hdr 2.1 / Interfaces / Processes.p < prev    next >
Text File  |  1995-09-12  |  5KB  |  192 lines

  1. { Converted with MPW2TPas Tuesday, September 12, 1995 8:53:17 PM }
  2. {
  3.      File:        Processes.p
  4.  
  5.      Contains:    Process Manager Interfaces.
  6.  
  7.      Version:    Technology:    System 7.5
  8.                  Package:    Universal Interfaces 2.1 in “MPW Latest” on ETO #18
  9.  
  10.      Copyright:    © 1984-1995 by Apple Computer, Inc.
  11.                  All rights reserved.
  12.  
  13.      Bugs?:        If you find a problem with this file, use the Apple Bug Reporter
  14.                  stack.  Include the file and version information (from above)
  15.                  in the problem description and send to:
  16.                      Internet:    apple.bugs@applelink.apple.com
  17.                      AppleLink:    APPLE.BUGS
  18.  
  19. }
  20.  
  21.  UNIT Processes;
  22.  INTERFACE
  23.  
  24.  
  25. {$IFC UNDEFINED __PROCESSES__}
  26. {$SETC __PROCESSES__ := 1}
  27.  
  28.   USES
  29.    ConditionalMacros, Types, Events, Files;
  30.  
  31. { $PUSH}
  32. { $ALIGN MAC68K}
  33. { $LibExport+}
  34.  
  35. TYPE
  36.     ProcessSerialNumber = RECORD
  37.         highLongOfPSN:            LONGINT;
  38.         lowLongOfPSN:            LONGINT;
  39.     END;
  40.  
  41.     ProcessSerialNumberPtr = ^ProcessSerialNumber;
  42.  
  43.  
  44. CONST
  45. { Process identifier - Various reserved process serial numbers }
  46.     kNoProcess                    = 0;
  47.     kSystemProcess                = 1;
  48.     kCurrentProcess                = 2;
  49.  
  50. { Definition of the parameter block passed to _Launch
  51.     Typedef and flags for launchControlFlags field }
  52.     
  53. TYPE
  54.     LaunchFlags = INTEGER;
  55.  
  56.  
  57. CONST
  58. { Definition of the parameter block passed to _Launch }
  59.     launchContinue                = $4000;
  60.     launchNoFileFlags            = $0800;
  61.     launchUseMinimum            = $0400;
  62.     launchDontSwitch            = $0200;
  63.     launchAllow24Bit            = $0100;
  64.     launchInhibitDaemon            = $0080;
  65.  
  66. { Format for first AppleEvent to pass to new process.  The size of the overall
  67.   buffer variable: the message body immediately follows the messageLength }
  68.  
  69. TYPE
  70.     AppParameters = RECORD
  71.         theMsgEvent:            EventRecord;
  72.         eventRefCon:            LONGINT;
  73.         messageLength:            LONGINT;
  74.     END;
  75.  
  76.     AppParametersPtr = ^AppParameters;
  77.  
  78. { Parameter block to _Launch }
  79.     LaunchParamBlockRec = RECORD
  80.         reserved1:                LONGINT;
  81.         reserved2:                INTEGER;
  82.         launchBlockID:            INTEGER;
  83.         launchEPBLength:        LONGINT;
  84.         launchFileFlags:        INTEGER;
  85.         launchControlFlags:        LaunchFlags;
  86.         launchAppSpec:            FSSpecPtr;
  87.         launchProcessSN:        ProcessSerialNumber;
  88.         launchPreferredSize:    LONGINT;
  89.         launchMinimumSize:        LONGINT;
  90.         launchAvailableSize:    LONGINT;
  91.         launchAppParameters:    AppParametersPtr;
  92.     END;
  93.  
  94.     LaunchPBPtr = ^LaunchParamBlockRec;
  95.  
  96. { Set launchBlockID to extendedBlock to specify that extensions exist.
  97.  Set launchEPBLength to extendedBlockLen for compatibility.}
  98.  
  99. CONST
  100.     extendedBlock                = $4C43;                        { 'LC' }
  101.     extendedBlockLen            = 32;                            { sizeof(LaunchParamBlockRec) - 12 }
  102.  
  103. { Definition of the information block returned by GetProcessInformation }
  104.     modeDeskAccessory            = $00020000;
  105.     modeMultiLaunch                = $00010000;
  106.     modeNeedSuspendResume        = $00004000;
  107.     modeCanBackground            = $00001000;
  108.     modeDoesActivateOnFGSwitch    = $00000800;
  109.     modeOnlyBackground            = $00000400;
  110.     modeGetFrontClicks            = $00000200;
  111.     modeGetAppDiedMsg            = $00000100;
  112.     mode32BitCompatible            = $00000080;
  113.     modeHighLevelEventAware        = $00000040;
  114.     modeLocalAndRemoteHLEvents    = $00000020;
  115.     modeStationeryAware            = $00000010;
  116.     modeUseTextEditServices        = $00000008;
  117.     modeDisplayManagerAware        = $00000004;
  118.  
  119. { Record returned by GetProcessInformation }
  120.  
  121. TYPE
  122.     ProcessInfoRec = RECORD
  123.         processInfoLength:        LONGINT;
  124.         processName:            StringPtr;
  125.         processNumber:            ProcessSerialNumber;
  126.         processType:            LONGINT;
  127.         processSignature:        OSType;
  128.         processMode:            LONGINT;
  129.         processLocation:        Ptr;
  130.         processSize:            LONGINT;
  131.         processFreeMem:            LONGINT;
  132.         processLauncher:        ProcessSerialNumber;
  133.         processLaunchDate:        LONGINT;
  134.         processActiveTime:        LONGINT;
  135.         processAppSpec:            FSSpecPtr;
  136.     END;
  137.  
  138.     ProcessInfoRecPtr = ^ProcessInfoRec;
  139.  
  140.  
  141. FUNCTION LaunchApplication(LaunchParams: LaunchPBPtr): OSErr;
  142.     {$IFC NOT GENERATINGCFM}
  143.     INLINE $205F, $A9F2, $3E80;
  144.     {$ENDC}
  145. FUNCTION LaunchDeskAccessory({CONST}VAR pFileSpec: FSSpec; pDAName: ConstStr255Param): OSErr;
  146.     {$IFC NOT GENERATINGCFM}
  147.     INLINE $3F3C, $0036, $A88F;
  148.     {$ENDC}
  149. FUNCTION GetCurrentProcess(VAR PSN: ProcessSerialNumber): OSErr;
  150.     {$IFC NOT GENERATINGCFM}
  151.     INLINE $3F3C, $0037, $A88F;
  152.     {$ENDC}
  153. FUNCTION GetFrontProcess(VAR PSN: ProcessSerialNumber): OSErr;
  154.     {$IFC NOT GENERATINGCFM}
  155.     INLINE $70FF, $2F00, $3F3C, $0039, $A88F;
  156.     {$ENDC}
  157. FUNCTION GetNextProcess(VAR PSN: ProcessSerialNumber): OSErr;
  158.     {$IFC NOT GENERATINGCFM}
  159.     INLINE $3F3C, $0038, $A88F;
  160.     {$ENDC}
  161. FUNCTION GetProcessInformation({CONST}VAR PSN: ProcessSerialNumber; VAR info: ProcessInfoRec): OSErr;
  162.     {$IFC NOT GENERATINGCFM}
  163.     INLINE $3F3C, $003A, $A88F;
  164.     {$ENDC}
  165. FUNCTION SetFrontProcess({CONST}VAR PSN: ProcessSerialNumber): OSErr;
  166.     {$IFC NOT GENERATINGCFM}
  167.     INLINE $3F3C, $003B, $A88F;
  168.     {$ENDC}
  169. FUNCTION WakeUpProcess({CONST}VAR PSN: ProcessSerialNumber): OSErr;
  170.     {$IFC NOT GENERATINGCFM}
  171.     INLINE $3F3C, $003C, $A88F;
  172.     {$ENDC}
  173. FUNCTION SameProcess({CONST}VAR PSN1: ProcessSerialNumber; {CONST}VAR PSN2: ProcessSerialNumber; VAR result: BOOLEAN): OSErr;
  174.     {$IFC NOT GENERATINGCFM}
  175.     INLINE $3F3C, $003D, $A88F;
  176.     {$ENDC}
  177. {$IFC NOT OLDROUTINELOCATIONS }
  178. PROCEDURE ExitToShell;
  179.     {$IFC NOT GENERATINGCFM}
  180.     INLINE $A9F4;
  181.     {$ENDC}
  182. {$ENDC}
  183.  
  184. { $ALIGN RESET}
  185. { $POP}
  186.  
  187. {$ENDC} {__PROCESSES__}
  188.  
  189.  IMPLEMENTATION
  190.  END.
  191.  
  192.